/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dk.rofl.units;

import rofl.Utils;

/**
 *
 * @author menderleit
 */
public abstract class UnitUtils {

    public static final int staminaValue = 6;
    public static final int baseCritChance = 5;
    public static final int levelCritChange = 2;
    public static final int baseParryChance = 70;
    public static final int levelParryChange = 2;
    
    public static boolean tryCrit(int levelDif) {
        boolean didCrit = false;
        int critChance = baseCritChance - (levelDif * levelCritChange);
        int crit = Utils.rnd().nextInt(100);
        if (crit < critChance) {
            didCrit = true;
        }
        return didCrit;
    }
    
    public static boolean tryParry(int levelDif) {
        boolean parried = false;
        int parryChance = baseParryChance - (levelDif * levelParryChange);
        int parry = Utils.rnd().nextInt(100);
        if(parry < parryChance) {
            parried = true;
        }
        return parried;
    }
}
